<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <meta http-equiv="X-UA-Compatible" content="ie=edge" />
        <title>17.正则的转义字符</title>
        <script>
            /**
             * 转义字符：
             * . 在正则里表示匹配任意字符
             * \. 在正则里表示.
             */
            // var str = 'abfdffc';
            /**
             * abc true
             * abfdffc true
             */
            // var re = /a.+c/;

            var str = 'a.c';
            /**
             * abc false
             * a.c true
             * a.......c true
             */
            var re = /a\.+c/;
            alert(re.test(str));
        </script>
    </head>
    <body>

    </body>
</html>
